package org.wadael.waverobotfrmwrk.advanced;

import com.google.wave.api.Blip;
import com.google.wave.api.event.Event;
import com.google.wave.api.impl.EventMessageBundle;

/**
 * One or many robotWorkers compose an advanced wave robot.  
 * 
 * @author jerome
 *
 */
public interface RobotWorker {

	/**
	 * Returns a string identifying an instruction delimiting the scope of this robot.
	 * Can be null, so that the worker is executed whatever the instruction. 
	 */
	public String getInstruction();
	
	/**
	 * Returns a description of the instruction's behaviour.
	 * This description is used when the robot's usage is displayed. 
	 * @return
	 */
	public String getDescription();
	
	/**
	 *  Entry-point for a worker.
	 * You get all the objects you can use.
	 * 
	 * @param bundle
	 * @param blip
	 * @param event
	 * @param parameters may be null
	 * @return
	 * 
	 */
	public boolean doWork( EventMessageBundle bundle, Blip blip,  Event event, String parameters );
	
	/**
	 * Return false if you do not want the command to be erased.
	 * @return
	 */
	public boolean areCommandsToClean();

	
	/**
	 * From a command, computes the value that will replace the 'call'
	 * Return null if command is not to be replaced
	 * 
	 * @param c
	 * @return
	 */
	public String getReplacingValue(Command c,EventMessageBundle bundle, Blip blip,  Event event);
	
	
//	/**
//	 * Replaces public boolean doWork( EventMessageBundle bundle, Blip blip,  Event event, String parameters )
//	 * The command is now passed on so you can know it all (like should I remove the command inputs from the blip ?)
//	 * 
//	 * Entry-point for a worker. You get all the objects you can use.
//	 * 
//	 * @param bundle
//	 * @param blip
//	 * @param event
//	 * @param commandToReactTo
//	 * @return
//	 * 
//	 * @since v2.1    (OMG a glimpse to the future)
//	 */
//	public boolean doWork( EventMessageBundle bundle, Blip blip,  Event event, Command commandToReactTo);
	

}
